#ifndef MS5611_
#define MS5611_


#ifdef __cplusplus
extern "C"
{
#endif

//Definition of MS5611 Register
#define MS5611_ADDR  0x77
#define MS5611_CMD_RESET    0x1E  	// ADC reset command
#define MS5611_CMD_ADC_READ 0x00  	// ADC read command
#define MS5611_CMD_ADC_CONV 0x40  	// ADC conversion command
#define MS5611_CMD_ADC_D1   0x00   // ADC D1 conversion
#define MS5611_CMD_ADC_D2   0x10   // ADC D2 conversion
#define MS5611_CMD_ADC_256  0x00   // ADC OSR=256
#define MS5611_CMD_ADC_512  0x02   // ADC OSR=512
#define MS5611_CMD_ADC_1024 0x04   // ADC OSR=1024
#define MS5611_CMD_ADC_2048 0x06   // ADC OSR=2048
#define MS5611_CMD_ADC_4096 0x08   // ADC OSR=4096
#define MS5611_CMD_PROM_RD  0xA0  	// Prom read command,from 0xA0 ~ 0xAE
							// 1 0 1 0 A2 A1 A0 0

#define MS5611_OSD_CONV_T_256	1	//in millisecond
#define MS5611_OSD_CONV_T_512	2	//in millisecond
#define MS5611_OSD_CONV_T_1024 	3	//in millisecond
#define MS5611_OSD_CONV_T_2048 	5	//in millisecond
#define MS5611_OSD_CONV_T_4096 	9	//in millisecond

#define MS5611_RESET_TIMING 	3	//in millisecond

#define sea_press 1013.25
#define FIRST_ORDER			0x01
#define SECOND_ORDER		0x02

Uint8 MS5611_CRC4(unsigned short *n_prom);
int MS5611_Reset(GIO_Handle inhd, GIO_Handle outhd);
short MS5611_Prom_RD(GIO_Handle inhd, GIO_Handle outhd, int*status, unsigned char coef_num);
int MS5611_CMD_ADCs(GIO_Handle inhd, GIO_Handle outhd, Uint32 * buf, Uint8 cmd);
int MS5611_GETDATA(GIO_Handle inhd, GIO_Handle outhd, double *data, Uint16 *coe, Uint8 mode);

#ifdef __cplusplus
}
#endif /* extern "C" */


#endif
